During my attempts to get the latest bridge networking model working on my
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 14 Sep 2005 16:49:23 +0000 (16:49 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 14 Sep 2005 16:49:23 +0000 (16:49 +0000)
system, I often invoked 'network-bridge stop' with total failure.  Attached
is an updated version that works.

Signed-off-by: Andrew Theurer <habanero@us.ibm.com>
tools/examples/network-bridge

index 24b3ae3a120a00d3e91f6be7e3e3471d9900f96c..342a2def9daf4c15d503a5f580f52b02e17dba3b 100755 (executable)
@@ -222,27 +222,31 @@ op_stop () {
         return
     fi
 
-    brctl delif ${bridge} ${netdev}
+    if ifconfig peth0 2>/dev/null | grep -q peth0 ; then
 
-    if ifconfig veth0 2>/dev/null | grep -q veth0 ; then
-        brctl delif ${bridge} vif0.0
         ifconfig vif0.0 down
-        mac=`ifconfig veth0 | grep HWadd | sed -e 's/.*\(..:..:..:..:..:..\).*/\1/'`
-        ifconfig ${netdev} down
-        ifconfig ${netdev} hw ether ${mac}
-        ifconfig ${netdev} arp up
-        transfer_addrs veth0 ${netdev}
-        transfer_routes veth0 ${netdev}
-        del_addrs veth0
-        ifconfig veth0 -arp down
-        ifconfig veth0 hw ether 00:00:00:00:00:00
+        mac=`ifconfig eth0 | grep HWadd | \
+            sed -e 's/.*\(..:..:..:..:..:..\).*/\1/'`
+        ifconfig ${netdev} 0.0.0.0 down
+        ifconfig ${netdev} hw ether fe:ff:ff:ff:ff:ff
+
+        ifconfig p${netdev} down
+        ifconfig p${netdev} hw ether ${mac} arp 
+        brctl delif ${bridge} p${netdev}
+
+        ip link set eth0 name veth0
+        ip link set peth0 name eth0
+        ifconfig ${bridge} down
+        brctl delbr ${bridge}
+        ifup eth0
+
     else
         transfer_routes ${bridge} ${netdev}
     fi
 }
 
 case ${OP} in
-  start)
+    start)
         op_start
         ;;